import Vue from 'vue'
import Router from 'uni-simple-router'

Vue.use(Router)

// 路由配置
const routes = [
  {
    path: '/',
    redirect: '/pages/index/index' // 默认跳转到首页
  },
  {
    path: '/pages/index/index',
    name: 'index',
    component: () => import('@/pages/index/index.vue'),
    meta: {
      title: '首页'
    }
  },
  {
    path: '/pages/login/login',
    name: 'login',
    component: () => import('@/pages/login/login.vue'),
    meta: {
      title: '登录'
    }
  }
]

const router = new Router({
  h5: {
    useHash: true
  },
  routes
})

export default router
